Create a classrooms table with this definition (try using a multi-line SQL statement):
+-----------+-----------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-----------+-----------------+------+-----+---------+----------------+ | id | int(3) unsigned | NO | PRI | NULL | auto_increment | | room_num | int(4) unsigned | NO | UNI | NULL | | | course_id | int(3) unsigned | YES | MUL | NULL | | +-----------+-----------------+------+-----+---------+----------------+
CREATE TABLE `classrooms` (
`id` int(3) unsigned NOT NULL AUTO_INCREMENT,
`room_num` int(4) unsigned DEFAULT NULL,
`course_id` int(3) unsigned DEFAULT NULL,
UNIQUE KEY(`room_num`),
PRIMARY KEY (`id`)
);
Create a classrooms table with this definition (try using a multi-line SQL statement): +-----------+-----------------+------+-----+---------+----------------+ | Field...
5. 2. Challenge Defining the reference table A mysql prompt has been opened for you. Using the college database, complete the following tasks (use either a single-line or a multi-line SQL statement): Create a courses table with this definition (try using a multi-line SQL statement): +---------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------+---------------------+------+-----+---------+----------------+ | id | int(3) unsigned | NO | PRI | NULL | auto_increment | | title | varchar(255) | NO...
stuck on creating view Use a SQL statement to create a view vIBM_MMM (year, month, IBM_price, MMM_price) that contains the year and month, average close prices of IBM and MMM for the year/month. Your view should directly access the Historial_price table to have the latest data. mysql> desc Historical_prices; +-----------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-----------+-------------+------+-----+---------+----------------+ | id | bigint(20) | NO | PRI | NULL | auto_increment | | symbol |...
Given the bsg_planets table created by using the following definition query : -- CREATE TABLE `bsg_planets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `population` bigint(20) DEFAULT NULL, `language` varchar(255) DEFAULT NULL, `capital` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 Insert information about the planet Mars which has a population of 2, language as "Binary" and "Olympus Mons" as Capital, in bsg_planets. Then list the row(s), with all the information for that...
11. Consider the following simple database with one table with the following schema: Field | Type Null key | Default | Extra auto_increment ! - I tid | int(4) NO | name varchar(30) | YES | | subji | int(2) | YES | subj2 | int(2) | YES I 1 subj3 | int(2) | YES | total | int(3) | YES PRI NULL | NULL NULL NULL NULL NULL - Transactions INSERT a tuple for a new student with the...
Using SQL and the following info Question 3: Find the people who do not have Viper Certification but are still assigned to Viper class ship Find the fname, lname, and ship_instance_id for all people who do not have Viper certification but are assigned to at least one instance of a Viper class ship (this includes all variants of Viper class ships). Return a row for every ship/person combination. Order your results by fname in ascending order. Use the BSG database...
Using SQL and the following info Question 3: Find the people who do not have Viper Certification but are still assigned to Viper class ship Find the fname, lname, and ship_instance_id for all people who do not have Viper certification but are assigned to at least one instance of a Viper class ship (this includes all variants of Viper class ships). Return a row for every ship/person combination. Order your results by fname in ascending order. Use the BSG database...
please write a file with the commands attached SQL commans For this assignment, submit a text file with the commands that you entered into your MySQL database on burrow to do the following: 1. (25 points) Create a table called Singer, when described it should have the following values: | Field I Type I Null Key Default l Extra | SingerID int (11) | FirstName | varchar (30) YESI I LastName varchar (30) YES I | Label | Salary I...
mysql> DESC shows; +--------------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+-------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | name | varchar(50) | YES | | NULL | | | network_id | int(11) | YES | | NULL | | | network_name | varchar(30) | YES | | NULL | | +--------------+-------------+------+-----+---------+----------------+ mysql> SELECT * FROM shows; +----+----------------+------------+--------------+ | id | name | network_id | network_name |...
1. Write SQL CREATE Table statement to create the following table with Owner ID as a surrogate key. Owner ID is a surrogate key (starts at 1 and increments by 1) hint: IDENTITY (1, 1) is syntax for surrogate key. PET_OWNER (OwnerID, OwnerLastName, OwnerFirstName, OwnerPhone, OwnerEmail) You can try inserting some data into your tables too! 2. Write SQL CREATE Table statement to create the following table with Pet ID as a surrogate key. Pet ID is a surrogate key...
create a view vHW1_Q3 with columns (state, population, NumofZipcode) showing the total population and the number of zip code (NumofZipcode) of each state and DC. The result should be sorted by the population size from high to low. The output should have 51 rows. using mysql Questions based on table Zipcode_info in datamining database. 50 US states and one DC means capital washington. these are fields in db +---------------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default |...