Question

In: Computer Science

Create a ‘Student’ table using SQL query. The table must have at least five attributes from...

Create a ‘Student’ table using SQL query. The table must have at least five attributes from your choice with different data types.

Solutions

Expert Solution

Answer:

We have to create a database in order to create table in MySQL.

Create database using following command in MySQL

                                  create database databasename; ( Syntax )

                               for example: create database Student;

                             

And use the created database using following command.

                             > use databasename; ( Syntax)

                             > use Student;

                            

Create a table Student using following command.

                  > create table Student(Student_ID VARCHAR(20), Student_Name CHAR(20), Student_DOB DATE, Student_Age INT, CGPA FLOAT(10,2));

Insert values to the Student table using following command;

> insert into Student values(Student_ID, Student_Name, Student_DOB, Student_Age, CGPA);

Retrieve the Student table details using following command.

                         > select *from Student;

Finally i have created a table Student table using five different attributes with different datatypes.

Thank you. Please ask me if you have any doubt.


Related Solutions

Using SQL create a new database called school_app. Create a student table with fields id (auto...
Using SQL create a new database called school_app. Create a student table with fields id (auto increment), first_name, last_name. Create a course table with fields id (auto increment), course code (such as ITC or MTH), and course number (such as 100 or 295). Note that the relationship between student and course is many-to-many (n:m). Create a join table called student_course that implements the n:m relationship with fields id (auto increment), student_id, course_id, and grade (which has values 0, 1, 2,...
How to write a query in SQL using the Group by function to decide if the...
How to write a query in SQL using the Group by function to decide if the results of the diet worked. There are 6 columns ID, Gender, treatment, start_weight_kg, end_weight_kg, and correct change (end weight minus start weight). With the information given write a SQL to determine if the the results(correct change) worked. Question is not incomplete.
Using Triggers (5 pts.) Execute the following SQL to create the customer_audit table in the premier...
Using Triggers (5 pts.) Execute the following SQL to create the customer_audit table in the premier schema. CREATE TABLE IF NOT EXISTS customer_audit ( customer_num CHAR(3) NOT NULL,   customer_name VARCHAR(35) NOT NULL, street VARCHAR(15), city VARCHAR(15), state CHAR(2), zip CHAR(5), credit_limit DECIMAL(8,2), date_changed DATETIME NOT NULL, changed_by VARCHAR(45) NOT NULL); Notice that the audit table does not have a primary key defined. Explain why this might be acceptable. Based on the current attributes in the customer_audit table, suggest a possible...
DBMS Create/Insert/Update SQL I need the create, insert, and update SQL statement for this table: Customer...
DBMS Create/Insert/Update SQL I need the create, insert, and update SQL statement for this table: Customer PK Customer ID Text Phone Number int name text address ID int email text FK vendor ID int Vendor is the name of the table the FK comes from.
Use a single SQL statement to create a relational table and to load into the table...
Use a single SQL statement to create a relational table and to load into the table department name, subject code, year of running and session of running that offered by the departments. Note that a running subject offered by a department means a lecturer of the department has been assigned to teach the subject. Next, enforce the appropriate consistency constraints on the new table.    When ready use SELECT statement to list the contents of the relational table created and...
Create a query in Access that uses two tables, the Patient table and the Session table. Add
Create a query in Access that uses two tables, the Patient table and the Session table. Add the LastName, FirstName, and SessionDate fields to the query grid. Run the query. How many records are displayed? Delete the join line between the field lists in Query Design View. Rerun the query. How many records are now displayed? Why are the results different? You do not need to save the queries. 
Problem: Each student must create and solve an apportionment problem using what you have learned in...
Problem: Each student must create and solve an apportionment problem using what you have learned in this chapter. The problem must have at least four "states" and 30 "seats". You must choose one of the four methods presented in this chapter (Hamilton's, Jefferson's, Adams' or Webster's) to apportion the "seats". If you use Hamilton's Method, you must go on to demonstrate the occurrence of one of the paradoxes (Alabama, Population, or New States). If you use one of the divisor...
Create a Database in POSTGRESQL using the following table names and attributes: users: userid (int, primary...
Create a Database in POSTGRESQL using the following table names and attributes: users: userid (int, primary key), name (text) movies: movieid (integer, primary key), title (text) taginfo: tagid (int, primary key), content (text) genres: genreid (integer, primary key), name (text) ratings: userid (int, foreign key), movieid (int, foreign key), rating (numeric), timestamp (bigint, seconds since midnight Coordinated Universal Time (UTC) of January 1, 1970) tags: userid (int, foreign key), movieid (int, foreign key), tagid (int, foreign key), timestamp (bigint, seconds...
Write a SQL query to find the movie Title that has received Lowest rating from reviewers,...
Write a SQL query to find the movie Title that has received Lowest rating from reviewers, but whose actors have received an award for their contribution in movie. Output: Fantastic Beasts and Where to Find Them            //   THE DATABASE // DROP DATABASE IF EXISTS cs431_movie_database; CREATE DATABASE cs431_movie_database; USE cs431_movie_database; CREATE TABLE `artists` ( `artist_id` INT NOT NULL AUTO_INCREMENT, `first_name` varchar(45) NOT NULL, `last_name` varchar(45) NOT NULL, `contact_no` varchar(15) DEFAULT NULL, `Profession` TEXT DEFAULT NULL, `birth_date` datetime DEFAULT NULL,...
Using the Quality Attributes Table document provided, complete a page table of quality attributes. Individual Assignment...
Using the Quality Attributes Table document provided, complete a page table of quality attributes. Individual Assignment – Week Four Complete the following table: Attribute Type Categories within the Attribute Type Example from the program Functional attributes <List the categories of attributes of this type (for example “Boolean”)> <Describe an attribute you can measure in your program (for example, user data integrity)> Operational attributes Usability attributes Business attributes Structural attributes
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT