sql advance

Ace your homework & exams now with Quizwiz!

What is a trigger? A) Trigger is the green hornet's horse. B)A trigger is executed when certain event occurs. C) A trigger is part of data extraction process. D)A trigger defines relations between tables.

A trigger is executed when certain event occurs.

What is a view? a)A view is a special data table. With very specific properties. Some of those properties are ACID. b)A view is a database diagram. c)A view is a virtual table d)A view is a special stored procedure executed when certain event occurs

A view is a virtual table

Which would add a new DATABASE named db? a)CREATE DATABASE db; b)CREATE NEW DATABASE db; c) CREATE db FROM NEW DATABASE; d)CREATE db;

CREATE DATABASE db;

Which SQL statement inserts data into a table called Projects? A)INSERT Projects VALUES ('Content Development', 'Website content development project') B)INSERT INTO Projects (ProjectName, ProjectDescription) VALUES ('Content Development', 'Website content development project') C)SAVE INTO Projects (ProjectName, ProjectDescription) VALUES ('Content Development', 'Website content development project') D)INSERT Projects ('Content Development', 'Website content development project')

INSERT INTO Projects (ProjectName, ProjectDescription) VALUES ('Content Development', 'Website content development project')

SELECT _____ FROM ______, ______; a)Relational Add b)Relational multiply c)Relational division d)Relational error

Relational Add

(SELECT ______ FROM ______) UNION ALL (SELECT ______ FROM ______); a)Relational Union b)Relational subtraction c)Relational Addition d)Relational Division

Relational Addition

SELECT ______ FROM ______ WHERE IN (SELECT ______ FROM ______); a)Relational Intersection b)Relational Addition c)Relational Union d)Relational Subtraction

Relational Intersection

(SELECT ______ FROM ______) UNION (SELECT _____ FROM ______); a)Relational intersection b)Relational multiply c)Relational division d)Relational union

Relational union

What is the MYSQL privilege used by the GRANT command to give a user READ-ONLY rights? a)VIEW b)READ c)SELECT d)READ-ONLY

SELEC T

Which command should a use to change the value of rating to 'PG' for movie_id 23 in table movies a)UPDATE movies SET rating="PG" WHERE movie_id=23; b)rating='PG'; c)UPDATE movies rating="PG" WHERE movie_id=23; d)CHANGE rating TO 23 FOR movie_id=23 IN movies;

UPDATE movies SET rating="PG" WHERE movie_id=23;

use the table Customers RIGHT JOIN Balances a)delta b)beta c)alpha d)cappa

alpha

The difference between the DELETE and TRUNCATE SQL clauses is: A)The TRUNCATE clause is identical to the DELETE clause B)The TRUNCATE clause deletes all rows in a database table, while the DELETE clause can have a WHERE condition and might or might not delete all rows in a table. C)The DELETE clause deletes all rows in a database table, while the TRUNCATE clause can have a WHERE condition and might or might not delete all rows in a table. D)The DELETE clause deletes the table while the TRUNCATE clause deletes only the records in the table.

b

What does the UNION ALL operator do? A)The UNION ALL operator sorts the selected result set. b)The UNION ALL operator combines the results of two or more queries into a one result that includes all the rows from the queries in the union with duplicates C)The UNION ALL operator combines the results of two or more queries into a one result that includes all the rows from the queries in the union without duplicates D)The UNION ALL operator behaves the same as the JOIN SQL clause.

b

use the table: Customers FULL JOIN Balances a) alpha b) delta c) cappa d) beta

beta

use the table: Customers LEFT JOIN Balances-- a)beta b)alpha c)delta d)cappa

cappa

The CREATE TABLE statement is used to... a)create a new database b)change existing table c) create a new table d)change existing database

create a new table

Which would remove a database table? A)REMOVE TABLE table; B)ZAP TABLE table; C)DELETE TABLE table; D)DROP TABLE table;

d

Which of the following SQL clauses is used to DELETE data from a database table? a)drop data b)delete c)remove d)clear

delete

Which of the following commands is used to delete data froma a SQL database table? a)delete b)erase c)destroy d)remove

delete

Which is correct? A)delete * from table students; B)delete from table students; C)delete * from students; D)delete from students;

delete from students;

The TRUNCATE TABLE... a)checks if the table has primary key specified b)deletes the table c)deletes all rows from a table d)delete the rest of the rows in a table

deletes all rows from a table

use the chart: Customers NATURAL JOIN Balances a)alpha b)cappa c)betta d)delta

delta

use the tables: Customers EQUA JOIN Balances a)delta b)beta c)alpha d)cappa

delta

Which of the following is correct? a)insert (first,last) values ('bob','nielson'); b)insert into customer first,last values 'bob','nielson'; c)insert into first,last values 'bob','nielson'; d)insert into customer (first,last) values ('bob','nielson');

insert into customer (first,last) values ('bob','nielson');

CREATE USER 'someuser'@'localhost' PASSWORD 'mypass'; will this statement work? A)yes b)no c)only in mysql d)only in oracle

no

INSERT INTO table; (column-1, column-2, ... column-n) VALUES; (value-1, value-2, ... value-n); will this work? a) yes b) no

no

When inserting data in a table do you always have to specify a list of all column names you are inserting values for? A)YES B)NO

no

SELECT _______ FROM _____ WHERE NOT EXISTS (SELECT _____ FROM _____ WHERE NOT EXISTS (SELECT _____ FROM ____ WHERE _____=______)); A)relational division B)relational join C)relational problem D)relational subtraction

relational division

SELECT _____ FROM _____ WHERE NOT EXISTS (SELECT _____ FROM _____); a)Relational Intersection b)Relational Division c)Relational Subtraction d)Relational Addition

relational subtraction

Which of the following is used to change data in a table? a)correct b)update c)modify d)edit

update

There are triggers for... a)insert and delete only b)insert and update only c)update and delete only d)update, delete and insert

update, delete and insert

DELETE FROM table WHERE column=value; Would this statement execute without error? A)ONLY IN ORACLE B)only on tuesday C)yes D)no

yes

If A={1,2,3] and B={2,3,4} What would A add B be? a){1,4} b){2,3} c){1,2,3,4} d){1,2,2,3,3,4}

{1,2,2,3,3,4}

If A={1,2,3] and B={2,3,4} What would A union B be? a){4} b){1,2,3,4} c){1} d){2,3}

{1,2,3,4}

If A={1,2,3] and B={2,3,4} What would A subtract B be? a){1,2,3,4} b){1} c){4} d){2,3}

{1}


Related study sets

Chapter 15 Understanding The Principles of Infection Control worksheets

View Set

Strategic Emphasis and Performances

View Set

Section 13 - Describing the Incident Response Plan

View Set

Introduction to Archaeology Midterm Study Guide Instructor Jane A. Hill

View Set