100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Examen

5. SQL - Queries, Programming, Triggers. Exam Questions With Verified And Updated Answers

Puntuación
-
Vendido
-
Páginas
5
Grado
A+
Subido en
24-11-2024
Escrito en
2024/2025

©THESTAR EXAM SOLUTIONS 2024/2025 ALL RIGHTS RESERVED. 1 | P a g e 5. SQL - Queries, Programming, Triggers. Exam Questions With Verified And Updated Answers What are the parts of a basic SQL query? - answerSELECT [DISTINCT] target-list FROM relation-list WHERE qualification relation-list - answerA list of relation names (possibly with a range-variable after each name). target-list - answerA list of attributes of relations in relation-list qualification - answerComparisons (Attr op const or Attr1 op Attr2, where op is one of <, >, =, <=, >=, != ) combined using AND, OR and NOT. DISTINCT - answeris an optional keyword indicating that the answer should not contain duplicates. Default is that duplicates are not eliminated! Are the input and result tables of an SQL query sets or multisets? - answerIf not using DISTINCT, the result tables are a set, else, multiset. How can you obtain a set of tuples as the result of a query? - answerTables are multisets of tuples. What are range variables in SQL? - answerReally needed only if the same relation appears twice in the FROM clause. It is good style, however, to use range variables always! SELECT S.sname FROM Sailors S, Reserves R WHERE S.sid=R.sid AND bid=103

Mostrar más Leer menos
Institución
Sql
Grado
Sql









Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
Sql
Grado
Sql

Información del documento

Subido en
24 de noviembre de 2024
Número de páginas
5
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

Vista previa del contenido

©THESTAR EXAM SOLUTIONS 2024/2025

ALL RIGHTS RESERVED.



5. SQL - Queries, Programming, Triggers.
Exam Questions With Verified And Updated
Answers

What are the parts of a basic SQL query? - answer✔SELECT [DISTINCT] target-list
FROM relation-list
WHERE qualification

relation-list - answer✔A list of relation names (possibly with a range-variable after each name).

target-list - answer✔A list of attributes of relations in relation-list

qualification - answer✔Comparisons (Attr op const or Attr1 op Attr2, where op is one of <, >, =,
<=, >=, != ) combined using AND, OR and NOT.

DISTINCT - answer✔is an optional keyword indicating that the answer should not contain
duplicates. Default is that duplicates are not eliminated!

Are the input and result tables of an SQL query sets or multisets? - answer✔If not using
DISTINCT, the result tables are a set, else, multiset.

How can you obtain a set of tuples as the result of a query? - answer✔Tables are multisets of
tuples.

What are range variables in SQL? - answer✔Really needed only if the same relation appears
twice in the FROM clause. It is good style, however, to use range variables always!




SELECT S.sname
FROM Sailors S, Reserves R
WHERE S.sid=R.sid AND bid=103



1|Page

, ©THESTAR EXAM SOLUTIONS 2024/2025

ALL RIGHTS RESERVED.
How can you give names to output columns in a query that are defined by arithmetic or string
expressions? - answer✔Each item in a select-list can be of the form expression AS
column_name, where expression is any arithmetic or string expression over column names
(possibly prefixed by range variables) and constants, and column_name
is a new name for this column in the output of the query.


SELECT S.age, age1=S.age-5, 2*S.age AS age2
FROM Sailors S
WHERE S.sname LIKE 'B_%B'

What support does SQL offer for string pattern matching? - answer✔SQL provides support for
___________ through the LIKE operator, along with the use of the wild-card symbols % (which
stands for zero or more arbitrary characters) and ~ (which stands for exactly one, arbitrary,
character). Thus, '_AB%' denotes a ___________ every string that contains at least three
characters, with the second and third characters being A and B respectively.
What operations does SQL provide over (multi)sets of tuples, and how would you use these in
writing queries? - answer✔UNION, INTERSECT, and EXCEPT

What are nested queries? - answer✔A very powerful feature of SQL: a WHERE clause can itself
contain an SQL query! (Actually, so can FROM and HAVING clauses.)


Find names of sailors who have reserved boat #103:
SELECT S.sname
FROM Sailors S
WHERE S.sid IN (SELECT R.sid
FROM Reserves R
WHERE R.bid=103)

What is correlation in nested queries? - answer✔SELECT S.sname
FROM Sailors S
WHERE NOT EXISTS (( SELECT B.bid
FROM Boats B )

2|Page
$10.49
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
TheStar Florida State University
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
589
Miembro desde
1 año
Número de seguidores
178
Documentos
23565
Última venta
5 horas hace
Stuvia Prodigy

Tested, Verified and Updated Study Materials with 100% Guaranteed Success.

3.8

117 reseñas

5
56
4
21
3
20
2
3
1
17

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes