Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

DBMS - CPSC 4620 Midterm | Que & answ

Rating
-
Sold
-
Pages
16
Grade
A+
Uploaded on
12-10-2025
Written in
2025/2026

DBMS - CPSC 4620 Midterm.

Institution
Course

Content preview

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

Written for

Course

Document information

Uploaded on
October 12, 2025
Number of pages
16
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$13.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
smartchoices Chamberlain College Of Nursing
Follow You need to be logged in order to follow users or courses
Sold
36
Member since
5 year
Number of followers
5
Documents
4499
Last sold
2 weeks ago

4.8

9 reviews

5
7
4
2
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions