subject

Assume that we have two tables bsg_people and bsg_planets. Just write the correct sql queries pertaining to the questions. CREATE TABLE `bsg_people` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`fname` varchar(255) NOT NULL,
`lname` varchar(255) DEFAULT NULL,
`homeworld` int(11) DEFAULT NULL,
`age` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `homeworld` (`homeworld`),
CONSTRAINT `bsg_people_ibfk_1` FOREIGN KEY (`homeworld`)
REFERENCES `bsg_planets` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB
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
(1) Find the population of the planet named 'Caprica'
(2) Find the first name, last name, and age of people from bsg_people whose age is NULL.
(3) 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 planet.
(4) Update age of all those people whose last name is 'Adama' and first name is 'William' to 62 and then print all rows with all the columns which match the same criteria, in a separate query.
(5) Create a table with the following properties:
Name: bsg_spaceship:
id - an auto-incrementing integer which is also the primary key
name- variable -length string with a max of 255 characters, cannot be null.
seperate_saucer_section- a boolean property which specifies whether or not there is a separate saucer section on the spaceship. This defaults to No.
length - integer, cannot be null
Once you have created the table, run the query "DESCRIBE bsg_spaceship;"

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:10, josued123321
Alook-up table used to convert pixel values to output values on a monitor. essentially, all pixels with a value of 190 or above are shown as white (i. e. 255), and all values with a value of 63 or less are shown as black (i. e. 0). in between the pixels are scaled so that a pixel with a value p is converted to a pixel of value 2/127 −+3969). if a pixel has a value of 170 originally, what value will be used to display the pixel on the monitor? if a value of 110 is used to display the pixel on the monitor, what was the original value of the pixel?
Answers: 1
image
Computers and Technology, 23.06.2019 23:40, lexiecooley
4. what is the reason for including the following code snippet in the header file animal. h? #ifndef animal_h #define animal_h class animal { public: animal(); animal(double new_area_hunt); void birth(); void hunt(double new_area_hunt); void death(); double get_area_hunt() const; private: double area_hunt; }; #endif
Answers: 3
image
Computers and Technology, 24.06.2019 00:00, Amrinderkhattra
Visualizing a game of “tag” to remember the meaning of contagious
Answers: 3
image
Computers and Technology, 25.06.2019 05:10, Aaraar
Maia notices that her paragraphs are too close to one another. she wants to increase this space. which arrangement of steps does maia follow after she goes to the paragraph command group in the ribbon? type in the space needed, go to the after menu, go to the spacing part of the box, and open the paragraph dialog box. go to the spacing part of the box, go to the after menu, open the paragraph dialog box, and type in the space needed. open the paragraph dialog box, go to the spacing part of the box, go to the after menu, and type in the space needed. type in the space needed, open the paragraph dialog box, go to the after menu, and go to the spacing part of the box.
Answers: 1
You know the right answer?
Assume that we have two tables bsg_people and bsg_planets. Just write the correct sql queries pertai...

Questions in other subjects:

Konu
Spanish, 24.11.2020 02:20