Quiz
++++++
Erstelle ein kostenloses Konto, um dieses Quiz zu beenden
Speichere deinen Fortschritt und sieh dir dein Endergebnis an.
oder mit deiner E-Mail registrieren
Schon ein Konto? Anmelden
Fragen in diesem Quiz (31)
1You are structuring a table in a relational database.
Instructions: For each of the following statement, select Yes if the statement is true. Otherwise, select No.- AEach value in a field in a table must be unique.
- BEach row in a table must be unique.
- CEach column name in a table must be unique.
2You work at a coffee shop. They ask you to set up a website that stores charges on purchases.
You need to recommend a data type in a database table to run financial functions against the charged amounts.
Which data type should you recommend?- AA. Money // Decimal
- BBit
- CVarchar
- DBinary
3Which two columns should you select? (Choose two.)

- AChapterId
- BLanguageId
- CCountry
- DRegion
- ECity
- FLanguageName
4You have a Department table and an Employee table in your database.
You need to ensure that an employee can be assigned to only an existing department.
What should you apply to the Employee table?- AA primary key
- BAn index
- CA foreign key
- DA unique constraint
- EA data type
5You have two tables named Salesperson and Sales.
You need to ensure that each record in the Sales table has a valid associated salesperson record in the Salesperson
table. Which database object should you add to the Sales table?- ANonclustered index
- BPrimary key
- CForeign key
- DClustered index
6Among the following, which sets limits or rules placed on a file or a column to ensure that the data is considered
valid for a database?- Achecker
- Bvalidator
- Cscanner
- Dconstraint
7A flower shop wants to see every flower ordered, but each flower should only show once. Which SQL statement
will fulfill that need?- ASELECT UNIQUE flowername FROM flowers
- BSELECT flowername FROM flowers DISTINCT
- CSELECT DISTINCT flowername FROM flowers
- DSELECT TOP 1 flowername FROM flowers
8A stored procedure contains the following query
SELECT 'Greetings' + Prefix + ' ' + FirstName FROM Person;
The stored procedure return all null values. You verify that there is data in the person table
What is likely the cause of the problem- AYou must specify the NULLIF keyword in the query
- BThe plus (+) operator cannot be used to append character data
- CThe Prefix or FirstName columns have null values
- DYou must specify the join keyword in the select statement
9You have the database table named Cars as defined below:

- A4
- B5
- C6
- D7
10A sales manager wants to see all customers with sales of at least 50000 who either reside in Los Angeles,
California, or in the states of Nevada or Arizona. Which SQL statement will satisfy the request?- ASELECT lastname, firstname
FROM customers
WHERE sales >-500ee OR ((city="Los Angeles' AND state='California') OR state IN ('Nevada', 'Arizona')) - BSELECT lastname, firstname
FROM customers
WHERE sales >500ee AND ((city="Los Angeles' AND state='California') OR state IN ('Nevada', 'Arizona')) - CSELECT lastname, firstname
FROM customers
WHERE sales >=50000 AND ((city="Los Angeles' AND state='California') OR state IN ('Nevada',
'Arizona')) - DSELECT lastname, firstname
FROM customers
WHERE sales >50000 OR((city="Los Angeles' AND state='California') AND state IN ('Nevada', 'Arizona'))
- ASELECT lastname, firstname
11The products table contains the following data

- ASELECT ItemName, Price
FROM Products
Where ItemDescription = ‘chocolate’; - BSELECT ItemName, Price
FROM Products
WHERE ItemDescription LIKE ‘%chocolate%’; - CSELECT ItemName, Price
FROM Products
WHERE ItemDEscription LIKE ‘chocolate’; - DSELECT ItemName, Price
FROM Products
WHERE ItemDescription IN ‘%chocolate%’;
- ASELECT ItemName, Price
12Which query returns a result set of orders placed after January 2017 in all states except California (CA)?
- ASELECT * FROM orders WHERE order_date > ‘2017-01-01’ AND ship_state < > ‘CA’
- BSELECT * FROM orders WHERE order_date > ‘2017-01-01’ OR ship_state < > ‘CA’
- CSELECT * FROM orders WHERE order_date ? ‘2017-01-01’ AND ship_state LIKE ‘CA’
- DSELECT * FROM orders WHERE order_date > ‘2017-01-01’ OR ship_state LIKE ‘CA’
13Drag and drop to complete the query to display customers from Utah, sorted by last name

- ASORT BY
- BORDER BY, WHERE
- CWHEN
- DHAVING
14You need to create a report of data in the students table. The report must meet the following requirements:
• Display all student who enrolled on or after June 1, 2020
• Display all student who graduated in 2020
• Return the result set in order of enrollment, with the most recent enrollment date first
Enrollment_Date specifies the enrollment date, Graduation_Date specifies the graduation date.
An Academic_Status Of Graduated indicates that a student has graduated.
Which query should you use ?- ASELECT * FROM student
WHERE enrollment_date >= ‘2020-06-01’ OR academic_status =’graduated’ AND
graduation_date >= ‘2020-01-01’
ORDER BY enrollment_date DESC - BSELECT * FROM student
WHERE enrollment_date >= ‘2020-06-01’ AND academic_status =’graduated’ AND
graduation_date >= ‘2020-01-01’
ORDER BY enrollment_date ASC - CSELECT * FROM student
Where enrollment_date >= ‘2020-06-01’ AND academic_status =’graduated’ OR
graduation_date >= ‘2020-01-01’
ORDER BY enrollment_date - DSELECT * FROM student
WHERE enrollment_date >= ‘2020-06-01’ OR academic_status =’graduated’ OR
graduation_date >= ‘2020-01-01’
ORDER BY enrollment_date DESC
- ASELECT * FROM student
15You have a table named Employee that includes the following columns: EmployeeID, Emp1oyeeName.
Which statement should you use to return the number of rows in the table?- ASELECT * FROM Employee
- BSELECT SUM(*) FROM Employee
- CSELECT COUNT (rows) FROM Employee
- DSELECT COUNT(*) FROM Employee
16Which SQL statement will return the country and number of orders in each country where the number of orders is
less than 50?
OrderID represent an individual order, Country represent the country, and Orders represents the number of orders- AA. SELECT COUNT (OrderId), Country
FROM Orders
HAVING COUNT(OrderId) < 50;
GROUP BY Country - BB. SELECT Country, OrderId
FROM Orders
GROUP BY Country
WHERE COUNT(OrderId) < 50; - CC. SELECT COUNT (OrderId), Country
FROM Orders
GROUP BY Country
HAVING COUNT(OrderId) < 50; - DD. SELECT Country, OrderId
FROM Orders
WHERE Count(OrderId) < 50;
GROUP BY Country
- AA. SELECT COUNT (OrderId), Country
17You are working with three tables: Students, Courses, and Enrollments.
You need to return the student name, course name, and grade for each enrollment. Which SQL query correctly
retrieves this information?
- ASELECT s.FirstName, s.LastName, c.CourseName, e.Grade
FROM Students s
JOIN Enrollments e ON s.StudentID = e.StudentID
JOIN Courses c ON e.CourseID = c.CourseID; - BSELECT FirstName, LastName, CourseName, Grade
FROM Students
JOIN Courses ON Students.StudentID = Courses.CourseID
JOIN Enrollments ON Students.StudentID = Enrollments.CourseID; - CSELECT s.FirstName, s.LastName, c.CourseName, e.Grade
FROM Students s, Courses c, Enrollments e
WHERE s.StudentID = e.StudentID AND e.CourseID = c.CourseID; - DSELECT s.FirstName, c.CourseName, e.Grade
FROM Students s
JOIN Enrollments e ON s.StudentID = c.CourseID
JOIN Courses c ON e.CourseID = c.CourseID;
- ASELECT s.FirstName, s.LastName, c.CourseName, e.Grade
18You execute the following statement:
SELECT EmployeeID, FirstName, DepartmentName
FROM Employee, Department;
This type of operation is called a/an:- AIntersection
- BOuter join
- CEqui-join
- DCartesian product
19The ____________ clause allows you to combine the results of any two or more queries into a resulting single set
that will include all the rows belonging to the query.- AUNION
- BINTERSECT
- CGROUP BY
- DWHERE
20The SQL __________ operator takes the results of two queries and returns only rows that appear in both result
sets.- AUNION
- BINTERSECT
- CEXCEPT
- DJOIN
21You have a table that contains the following data.
Which database term is used to describe the relationship between ProductID and ProductCategory?
- ACohort
- BRelationally dependent
- CDeterministic
- DFunctionally dependent
- ECompositional
22You ate creating a database object named Student to store the following data:
Which syntax should you use to create the object?
- ACREATE TABLE Student (
ID INT,
Name VARCHAR(100),
Age INT ) - BCREATE (
TABLE Student ID INT,
Name VARCHAR(100),
Age INT ) - CCREATE Student ( ID INT,
Name VARCHAR(100),
Age INT ) - DCREATE TABLE ID INT,
Name VARCHAR(100),
Age INT
- ACREATE TABLE Student (
23A developer adds a Prefix column with NOT NULL but encounters an error.
ALTER TABLE Person ADD Prefix varchar(4) NOT NULL;
What is the likely cause?- AThe Person table is empty.
- BYou should run the DROP CONSTRAINT query before running the ALTER TABLE query.
- CThe varchar(4) data types is invalid for the Person table.
- DThe DEFAULT keyword should be used to specify a default value.
24You have a table named Customer. You need to add a new column named District.
Which statement should you use?- AMODIFY TABLE Customer ADD (District INTEGER)
- BALTER TABLE Customer MODIFY (District INTEGER)
- CMODIFY TABLE Customer (District INTEGER)
- DALTER TABLE Customer ADD (District INTEGER)
25You have a database table that contains the following columns:
You must insert the following record into the table:
- AINSERT INTO AddressInfo ('1234 Main Street', 'Dallas', 'TX', '75201')
VALUES ([StreetAddress], [City], [State], [PostalCode - BINSERT INTO Address Info ([StreetAddress], [City], [State], [PostalCode])
VALUES ('1234 Main Street', 'Dallas', 'TX', '75201') - CINSERT INTO AddressInfo VALUES ('1234 Main Street', 'Dallas', 'TX', '75201')
- DUPDATE Address Info
SET [StreetAddress]='1234 Main Street', [City]='Dallas', [State]='TX', [PostalCode]='75201'
- AINSERT INTO AddressInfo ('1234 Main Street', 'Dallas', 'TX', '75201')
26You have a table named Product that contains the following data.
The PrcducrID column is the primary key. The CategoryID column is a foreign key to a separate table Category.
You execute the following statement:
INSERT INTO Product
VALUES (3296, 'Table', 4444)
What is the result?
- Aa foreign key constraint violation
- Ba syntax error
- Ca new row in the Product table
- Da primary key constraint violation
- Ea new row in the Category table
27You create the following table, which lists how many books you have on loan to your friends.

- AUPDATE LoanedBooks SET Books = 0 WHERE (Name = 'Harry' AND City = 'San Francisco')
- BUPDATE LoanedBooks SET Books = 0 WHERE (Name = 'Harry' OR City = 'San Francisco')
- CUPDATE LoanedBooks SET Books = 0 WHERE (Name in 'Harry', 'San Francisco')
- DINSERT INTO LoanedBooks SET Books = 0 WHERE ID =4
28You have a table named Student that contains 100 rows. Some of the rows have a NULL value in the FirstName
column.
You execute the following statement:
DELETE FROM Student;
What is the result?- AAll rows in the table will be deleted.
- BAll rows containing a NULL value in the FirstName column will be deleted.
- CYou will receive an error message
- DAll rows and the table definition will be deleted.
29Instructions: For each of the following statements, select Yes if the statement is true. Otherwise, select No. Each
correct selection is worth one point.- AYou can delete data by using a stored procedure. – YES / NO
- BA function must have a return value. – YES / NO
- CA stored procedure must have a return value. – YES / NO
30This question requires that you evaluate the underlined text to determine if it is correct.
Use the ALLOW SELECT command to give a user permission to read the data in a table.
Instructions: Review the underlined text. If it makes the statement correct, select "No change is needed." If the
statement is incorrect, select the answer choice that makes the statement correct- ANo change is needed
- BGRANT SELECT
- CLET HEAD
- DPERMIT READ
31You need to disable User1's access to view the data in the Customer table.
Which statement should you use?- AREMOVE User1 FROM Customer
- BREMOVE SELECT ON Customer FROM User1
- CREVOKE SELECT ON Customer FROM User1
- DREVOKE User1 FROM Customer
Informationen
- Beschreibung
- Quiz am ++++++, erstellt von Lilian Sw am 26/04/2026.
- Autor
- Lilian Sw
- Sprache
- English
- Aufrufe
- 132
- Bewertung
- Noch keine Bewertungen Bewerte dieses Quiz
Mehr zu Relational Databases and the Relational Model