A Guide to SQL
A Guide to SQL
9th Edition
ISBN: 9781111527273
Author: Philip J. Pratt
Publisher: Course Technology Ptr
Expert Solution & Answer
Book Icon
Chapter 3, Problem 12RQ

Explanation of Solution

 Difference between “CHAR” and “VARCHAR”:

 

CHARVARCHAR
“CHAR” is fixed length data type.“VARCHAR” is the variable length data type.
The storage size is equal to the maximum size of the column.The storage size is equal to the actual length of the data.
The keyword “CHAR” is used to declare the variable...

Explanation of Solution

 Appropriate place to use “CHAR” data type:

 The “CHAR” data type is a good choice when storing the initial of the name as it takes up the same amount of bytes. It is also suitable to specify the name of the individual as it hold only the list of characters.

 Example:

CREATE TABLE EMPLOYEE (

EMP_NU...

Explanation of Solution

 URL:

 The following given URL provides the examples as referen...

Blurred answer
Students have asked these similar questions
You will be using the Colonial Adventure Tours database. List the trip IDs and trip names for each pair of trips that have the same start location.(You will need to assign an alias). The first trip id should be the major sort key, and the second trip id  should be the minor sort key.
This does not work: CREATE OR REPLACE TRIGGER trg_char_hours AFTER INSERT ON CHARTER FOR EACH ROW BEGIN UPDATE AIRCRAFT SET AC_TTAF = AC_TTAF + NEW.CHAR_HOURS_FLOWN, AC_TTEL = AC_TTEL + NEW.CHAR_HOURS_FLOWN, AC_TTER = AC_TTER + NEW.CHAR_HOURS_FLOWN WHERE AIRCRAFT.AC_NUMBER = NEW.AC_NUMBER; END; I get the following error:   ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIGGER trg_char_hours AFTER INSERT ON CHARTER FOR EACH ROW BEGIN UPDATE AIRCRAF' at line 1   Here is the original question:   Create a trigger named trg_char_hours that automatically updates the AIRCRAFT table when a new CHARTER row is added. Use the CHARTER table’s CHAR_HOURS_FLOWN to update the AIRCRAFT table’s AC_TTAF, AC_TTEL, and AC_TTER values. (Hint: use temp values, as the INSERT event does not accept the OLD keyword.)
Refer to the film and inventory tables of the Sakila database. The tables in this lab have the same columns and data types but fewer rows. Write a query that lists the titles of films with the fewest rows in the inventory table. This query requires a subquery that computes the minimum of counts by film_id: SELECT MIN(count_film_id) FROM ( SELECT COUNT(film_id) AS count_film_id FROM inventory GROUP BY film_id ) AS temp_table; This subquery is provided in the template.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Text book image
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Text book image
Oracle 12c: SQL
Computer Science
ISBN:9781305251038
Author:Joan Casteel
Publisher:Cengage Learning
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Cengage Learning
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning