databases Sections 3,4 and 5
The ____ clause filters rows - correct answer ✔WHERE
What query would we use to select all the employees from the Employee table
whose first name is the same as his last name? - correct answer ✔SELECT
*
FROM Employee
WHERE firstName = lastName
In SQL, how can you return all the rows from a table named "Employee"
sorted in descending order by firstName? - correct answer ✔SELECT *
FROM Employee
ORDER BY firstName DESC
_____ is used to sort - correct answer ✔ORDER BY
Commands that organize information in ascending and descending order: -
correct answer ✔ASC and DESC
Default setting for organizing information in order: - correct answer
✔ascending (ASC)
In SQL, how do you delete a row from a table? - correct answer ✔DELETE
FROM tableName
WHERE column = value;
, In SQL, how do you select all the columns from a table named "Employee"? -
correct answer ✔SELECT FirstName FROM Persons
The syntax to add new rows to a table is: - correct answer ✔INSERT INTO
TableName (column list)
VALUES (value list);
The syntax to list all the rows of the Employee table and FamilyMember table
that match on the employeeId attribute is: - correct answer ✔SELECT *
FROM Employee JOIN FamilyMember
ON Employee.employeeId = FamilyMember.employeeId
Generically:
SELECT *
FROM table1 JOIN table2
ON table1.PK = table2.FK;
The _____ in the ON clause are generally primary and foreign keys. - correct
answer ✔columns
To select all the rows from a table named "Employee" where the value of the
column "firstName" is "John": - correct answer ✔SELECT *
FROM Employee
WHERE firstName = 'John'
The equality comparison operator is "=".