Question: Write a SQL Query to find the population of this table named 'Caprica'... Code provided -- CREATE TABLE `bsg_planets` ( -- `id` int(11) NOT NULL
Write a SQL Query to find the population of this table named 'Caprica'...
Code provided

-- 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 --
-- Write your query BELOW this line.

-- 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 -- -- Find the first name, last name, and age of people from bsg_people whose -- last name is not 'Adama' - 10 points
-- Write your query BELOW this line.

-- 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 -- -- Find the name and population of the planets with a population larger than -- 2,600,000,000 - 10 points
-- Write your query BELOW this line.
1. Write a SQL query to find the population of the planet named 'Caprica' -- 10 points 2. Find the first name, last name, and age of people from bsg people whose last name is not 'Adama' -- 10 points 3. Find the name and population of the planets with a population larger than 2,600,000,000 -- 10 points
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
