






























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Various topics related to entity-relationship diagrams and sql queries. It discusses different types of binary relationships, such as one-to-one, one-to-many, and many-to-many, as well as unary and ternary relationships. The document also explores sql statements, including data definition language (ddl) commands, data manipulation language (dml) commands, and various clauses and functions. Topics covered include creating and modifying tables, managing indexes, implementing referential integrity, and performing data retrieval and manipulation. A comprehensive overview of these database concepts and their practical applications.
Typology: Exams
1 / 38
This page cannot be seen from the preview
Don't miss anything!































Attempt # Status: Passed
A salesperson is authorized to sell many products and a product can be sold by many salespersons. Which kind of binary relationship does this scenario describe? YOUR ANSWER CORRECT ANSWER One-to-one One-to-many Many-to-many One-to-one binary
Which kind of relationship is displayed in this entity-relationship diagram? YOUR ANSWE R CORRECT ANSWER Unary one-to-one Unary many-to-many Binary one-to-one Binary many-to- many Ternary one- to-one Ternary many-to-many
How is this portion of the entity-relationship diagram read, from left to right? YOUR ANSWE R CORRECT ANSWER No books are written by an author. At least one book was written by an author. One book was written by more than one author. Only one book was written by one author.
Which two examples are attributes? Choose 2 answers YOUR ANSWE R CORRECT ANSWER A person attending a meeting An employee number A sales meeting A meeting code
member ( member_id INT UNSIGNED NOT NULL AUTO_INCREMENT, PRIMARY KEY (member_id), last_name VARCHAR(20) NOT NULL, first_name VARCHAR(20) NOT NULL, suffix VARCHAR(5) NULL, expiration DATE NULL, email VARCHAR(100) NULL, street VARCHAR(50) NULL, city VARCHAR(50) NULL, state VARCHAR(2) NULL, zip VARCHAR(10) NULL, phone VARCHAR(20) NULL, interests VARCHAR(255) NULL ); Which two columns are created as something other than variable-length strings in this statement? Choose 2 answers YOUR ANSWER CORRECT ANSWER member_id last name sufkx expiration email city
Employee_IDEmployee_NameOffice_Address 12342 Jacob 54123 Main Street 12346 Michael 354 Center Avenue 12846 Ethan 54123 Main Street 12887 Joshua 54123 Main Street 12894 Daniel 354 Center Avenue 13097 Alexander 354 Center Avenue
13112 Anthony 54123 Main Street
YOUR ANSWER CORRECT ANSWE R Foreign Primary Compound Composite
In this entity-relationship diagram, many salespersons are shown as working in at least one office. How is the relationship between salespersons and offices represented in the diagram? YOUR ANSWE R CORRECT ANSWER It is undekned. It is linked through the ofkce ID. It is linked through the salesperson ID.
YOUR ANSWER CORRECT ANSWE R It is indicated by the tables’ adjacency.
Which command creates a database only if it does not already exist? YOUR ANSWE R CORRECT ANSWER IF NOT EXISTS db_name ; CREATE DATABASE IF NEW db_name ; CREATE DATABASE IF NOT EXISTS db_name ; IF NOT EXISTS CREATE DATABASE db_name ;
Refer to the given SQL statement. SELECT PRODNUM, PRODNAME FROM PRODUCT Which line should be added to the end of the statement to return the product numbers and product names for products that cost 20 dollars?
YOUR ANSWER CORRECT ANSWE R The associative entity The rows to be included A table’s intersection data A range of included columns
Refer to the given SQL statement. SELECT EMPNUM FROM EMPLOYEE Which line added to the end of the statement returns employee numbers of at least 1000? YOUR ANSWE R CORRECT ANSWER WHERE EMPNUM = 1000+; WHERE EMPNUM > 1000; WHERE EMPNUM => 1000; WHERE EMPNUM
= 1000;
Refer to the given SQL statement. SELECT PRODNUM, SUM(QUANTITY) FROM SALESPERSON Which line, when added to the end of the statement, returns the total number of each kind of product by product number? YOUR ANSWE R CORRECT ANSWER
YOUR ANSWER CORRECT ANSWE R SUM PRODNUM;
YOUR ANSWER CORRECT ANSWE R The VALUES list must contain a value for each non-null valued column in the table. The VALUES list must contain a value for each row in the table. The INSERT INTO portion of the statement must generate a LOAD DATA statement. The INSERT INTO portion of the statement must refer to a sampdb database table.
Refer to the given SQL statement. CREATE TABLE mytbl ( f FLOAT(10,4), c CHAR(15) NOT NULL DEFAULT 'none', i TINYINT UNSIGNED NULL ); Which kind of data type is FLOAT in this statement? YOUR ANSWE R CORRECT ANSWER Decimal Integer Strin g Data
Which two SQL data types can represent images or sounds? Choose 2 answers
YOUR ANSWER CORRECT ANSWE R INT FLOAT BINAR Y TERNARY TINYBLOB SOUNDBLOB
Refer to the given SQL statement. CREATE TABLE CUSTOMER (CustomerID INT NOT NULL AUTO_INCREMENT, LastName VARCHAR(100) NOT NULL, FirstName VARCHAR(100) NOT NULL, PRIMARY KEY ( CustomerID )); Which component of the command indicates the table’s name? YOUR ANSWER CORRECT ANSWER TABLE CUSTOMER CustomerID CUSTOMER INT
Which method creates an empty copy of a table and then populates it from the original table? YOUR ANSWE R CORRECT ANSWER
YOUR ANSWER CORRECT ANSWE R DROP TABLE
Why is a view used to give controlled access to data? YOUR ANSWE R CORRECT ANSWER To add complexity to encryption techniques To move complicated security routines to subqueries To restrict access to persons retrieving and modifying sensitive information To limit many-to-many relationships between various entities and attributes
A database manager plans to create a view of a table and has these two elements:
Refer to the given SQL statement. SELECT product_name, product_number, mfg_city FROM product;
Which statement, when added before this statement, generates a view? YOUR ANSWER CORRECT ANSWER VIEW viewprod: ALTER viewprod AS WHERE VIEW viewprod IS CREATE VIEW viewprod AS
What is the proper command to change a view? YOUR ANSWE R CORRECT ANSWER ALTER VIEW CHANGE VIEW MODIFY VIEW UPDATE VIEW
Refer to the given statement. DROP VIEW EMPLOYEE; What happens as a result of the execution of this statement to the HRDB table on which the EMPLOYEE view is based? YOUR ANSWE R CORRECT ANSWER