CST363: Learning Journal Week 2
1.SQL has the flexibility to join tables on any column(s) using any predicate (=, >, < ). Most of the time the join will use equality between a primary and foreign key. Think of example where joining on something other than keys would be needed. Write the query both as an English sentence and in SQL. If you can't think of your own example, search the textbook or internet for an example.
SELECT e.employee_id, e.employee_name, e.supervisor_id, s.supervisor_name
FROM employees e
LEFT JOIN supervisors s ON e.supervisor_id = s.supervisor_id;
2.What is your opinion of SQL as a language? Do you think it is easy to learn and use? When translating from an English question to SQL, what kinds of questions do you find most challenging?
SQL is a powerful and widely used language for managing relational databases. It provides a standardized way to interact with databases, making it easy to retrieve, update, and manipulate data. The language is relatively easy to learn, especially for basic queries, and its syntax is expressive and readable.
When translating from an English question to SQL, the most challenging part might be structuring complex queries involving multiple tables or incorporating advanced features like subqueries or window functions. Understanding the database schema and relationships is crucial for crafting effective SQL queries.
Overall, SQL is a valuable skill for anyone working with databases, and its versatility makes it suitable for a wide range of applications.
Comments
Post a Comment