• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 3 fuera de 16 páginas
Examen

DBMS - CPSC 4620 Midterm | Que & answ

Document preview thumbnail
Vista previa 3 fuera de 16 páginas

DBMS - CPSC 4620 Midterm.

Vista previa del contenido

DBMS - CPSC 4620 Midterm | Que & answ




Write a mySQL statement DESCRIBE pet;

that can print out the

structure of table pet.

Please write a SQL INSERT INTO pet VALUES ('Winnie','John','Bear','m','1990-04-

statement to insert a 08',NULL);

record into the table "pet"

with the following values:

Name: Winnie, Owner:

John, Species: Bear, Sex:

m, Birth: 1990-04- 08,

Death: Null

Write an SQL statement to SELECT name, owner, birth

list the name, owner, and FROM pet WHERE sex = 'm'

birth date of the male pets and birth > '1990-01-01';

whose birth dates are after

1990-01-01.

Write an SQL statement to SELECT name, species, birth FROM pet ORDER BY birth DESC

show the name, species, LIMIT 1;

and birth date pf the

youngest pet in the table

pet.

,Write an SQL statement SELECT name, owner, birth

using mySQL pattern FROM pet WHERE name

matching to show name, LIKE 'B%Y';

owner, and birth date of

the pets whose names

start with 'B' and end with

'Y' in table pet.

Write an SQL statement SELECT name, owner, birth

using regular expression FROM pet WHERE name

pattern matching to show RLIKE '^F.*[yr]$';

name, owner, and birth

date of the pets whose

names start with 'F' and

end with 'y' or 'r' in table

pet.

Write an SQL statement to SELECT species, count(*) AS

query table pet to show num FROM pet GROUP BY

species and the number of species;

pets in each species as

num.

Write an SQL statement to SELECT pet.name, pet.owner, event.date,

sidplay the name, owner, event.remark FROM pet inner join event ON

ecebt date, and remarks of pet.name = event.name

pets that had "litter" after WHERE event.type='litter' AND event.date > '1995-01-01';

1995-01-01.

Write an SQL statement to UPDATE pet SET sec='m' WHERE name = 'Whistler';

change the sex of pet

, named "Whistler" to "m".

Write an SQL statement to DELETE FROM pet WHERE species='dog';

remove all dogs from table

pet.

Use only one UNIX mysql- h mysql.cs.clemson.edu -u usr -ppass menagerie

command to log into

database "menagerie"

from a terminal window

opened on machine

"trusty2.cs.clemson.edu",

assuming mySQL client is

installe on

"trusty2.cs.clemson.edu"

already, your username is

"usr" and password is

"pass".

After you log into a CREATE TABLE pet (name varchar(20), owner

database, you will enter the varchar(20), species varchar(20), sex char(1), birth

mySQL command line DATE, death DATE);

interface. Now, you want to

create a table "pet". The

type for fields "name",

"owner", and "species" is

character string with length

varying from 1 to 20

characters. The field "sex"

is CHAR type with length 1.

The type for fields "birth"

and "death" is DATE. Please

Información del documento

Subido en
12 de octubre de 2025
Número de páginas
16
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$13.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

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.
smartchoices
4.8
(9)
Vendido
39
Seguidores
5
Artículos
4500
Última venta
1 mes hace



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