Section 2 Question and answers 100% correct 2024 Queries
The Movie table has the following columns:
ID - positive integer
Title - variable-length string
Genre - variable-length string
RatingCode - variable-length string
Year - integer
Write ALTER statements to make the followin...
Section 2
An SQL ______ is a complete command composed of one or more clauses. A
______ groups SQL keywords like SELECT, FROM, and WHERE with table
names like City, column names like Name, and conditions like Population >
100000
statement, clause
The SQL language is divided into five sublanguages:
Data Definition Language (DDL) defines the structure of the database.
Data Query Language (DQL) retrieves data from the database.
Data Manipulation Language (DML) manipulates data stored in a database.
Data Control Language (DCL) controls database user access.
Data Transaction Language (DTL) manages database transactions.
The ______ DATABASE statement creates a new database. Once a
database is created, tables can be added to the database. The ____
DATABASE statement deletes the database, including all tables in the
database.
,CREATE, DROP
The _____ statement provides database users and administrators with
information about databases, the database contents (tables, columns, etc.),
and server status information.
SHOW
Commonly used SHOW statements include:
SHOW DATABASES lists databases available in the database system.
SHOW TABLES lists tables available in the currently selected database.
SHOW COLUMNS lists columns available in a specific table named by a
FROM clause.
SHOW CREATE TABLE shows the CREATE TABLE statement for a given
table.
The ____ statement selects a database and is required to show information
about tables within a specific database.
USE
SHOW AND USE EXAMPLE
, When creating a table, every table column must be assigned a data type.
Common data types include: integer, decimal, date and time, and character.
Most databases allow integer and decimal numbers to be signed or unsigned.
A ____ number is a number that may be negative.
An _______ number is a number that cannot be negative.
signed, unsigned
Integer Types
Decimal Types
Date and Time Types
Character Types
T or F?
The statement DROP Employee; deletes the Employee table.
False
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller Academia199. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $13.49. You're not tied to anything after your purchase.