50 Multiple choice questions
- • The number and order of the columns must be the same in all queries.
• The data types must be compatible.
- asterisk (*) in the place where the column name(s) would otherwise be given.
- ...all of the related tables are deleted using a cascading delete.
- - You can identify and delete individual rows from the database using the DELETE syntax,
- delete all the rows using a truncate table statement, or
- remove the entire table using the drop table statement.
- LEFT OUTER JOIN, RIGHT OUTER JOIN, and FULL OUTER JOIN.
- WHERE NOT department = 'shipping'
- The SQL command for retrieving any data from a database
- removes the actual data (delete all the rows) from within the table, but it leaves the table structure in place for future use.
- Referential integrity
- retrieve user-requested information from a database through the use of queries.
- SELECT ProductID
result set where data exists in the first query and not in the second
dataset (returns any distinct values from the left query that are not
also found on the right query)
- TRUNCATE TABLE <table_name>
- values you would like to insert.
- allow you to match related records taken from different source tables.
- BEGIN TRAN and a COMMIT or ROLLBACK while performing maintenance tasks, you will catch most accidents before they happen.
- SELECT ProductID
- can include records from one or both tables you are querying that do not have any corresponding record(s) in the other table.
- FROM clause.
- you may wish to have a table join with itself, say if you want to compare records from within the same table.
- SSMS or the INSERT statement.
- return all rows from one table along with all rows from the other table. WHERE conditions should always be included.
- DELETE FROM <table_name>
- remove one or more rows in a table or view.
- Add a record in the department table with our new supervisor's name and department ID information.
- you want a list of all employees who don't work in the shipping department.
- • Columns to retrieve
• Tables to retrieve the columns from
• Conditions, if any, that the data must satisfy
- • Inner joins
• Outer joins
• Cross joins
- comma-separated list of the column names in the table you wish to include
- DELETE FROM employee
WHERE department = 'accounting'
- SELECT first_name, last_name, salary
WHERE salary >= 50,000
- change data in a table or view.
- SELECT * FROM employees
- allows you to combine related data from multiple table sources.
- INSERT INTO employee (first_name, last_name, employee_id, department) VALUES ('David', 'Clark', 610008, 'shipping'),
('Arnold', 'Davis', 610009, 'accounting')
- transactions when updating data.
- square brackets or double quotes—for example, [first name] or "first name"
- search data in terms of what you don't want in your output.
- BEGIN TRAN
DELETE FROM <table_name>
you to combine the results of two or more queries into a resulting
single set that includes all the rows belonging to the query in that
- SELECT first_name, last_name
WHERE department = 'shipping'
query uses the AND conjunction to yield the names of all employees who
are in the shipping department and who are female.
- UPDATE employee
SET department = 4
WHERE department IS NULL
- DROP TABLE <table_name>
Remove an entire table.
result set where values in both of the queries match by the query on
both the left and right sides of the operand (returns any distinct
values found on both the left and right sides of this operand)
- allows you to specify the range to be used in a "between x and y" query format.
- • Open the SSMS interface.
• Open the table in which you wish to update data.
• Locate the row in which you wish to update the records within the Open Table view.
the SSMS application -> connected to the database -> Databases
folder -> Tables folder -> Right-click the table name and chose
Edit Top 200 Rows -> Enter your data into the last row of the table
- you want to give your boss a list of employees whose salary is above $50,000 per year.