The document shows the steps taken to connect to a MySQL database, select a database, create and populate a table, update data in the table, and view the table contents. There are some syntax errors encountered and corrected along the way.
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
47 views
Ass 3
The document shows the steps taken to connect to a MySQL database, select a database, create and populate a table, update data in the table, and view the table contents. There are some syntax errors encountered and corrected along the way.
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5
Enter password: *****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 19 Server version: 8.0.34 MySQL Community Server - GPL
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databses;
ERROR 1064 (42000): 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 'databses' at line 1 mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sakila | | sys | | world | +--------------------+ 6 rows in set (0.02 sec)
mysql> insert into industry (srno,part_name,model_no,supplier,quantity)
-> values(1,"engine",335,"pune",90) -> values(2,"brakes",335,"bombay",35) -> values(3,"car oil",236,"kolkata",98) -> values(4,"tyres",789,"chennai",168) -> values(5,"seat cover",345,"ahemdabad",35) -> values(6,"a/c",789,"allahabad",20); ERROR 1064 (42000): 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 'values(2,"brakes",335,"bombay",35) values(3,"car oil",236,"kolkata",98) values(4' at line 3 mysql> insert into industry (srno,part_name,model_no,supplier,quantity) -> values(1,"engine",335,"pune",90); Query OK, 1 row affected (0.01 sec)
mysql> insert into industry (srno,part_name,model_no,supplier,quantity)
ERROR 1064 (42000): 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 'industry' at line 1 mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sakila | | sys | | world | +--------------------+ 6 rows in set (0.00 sec)
ERROR 1064 (42000): 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 'industry' at line 1 mysql> show industry; ERROR 1064 (42000): 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 'industry' at line 1 mysql> SELECT * FROM industry; +------+------------+----------+-----------+----------+ | srno | part_name | model_no | supplier | quantity | +------+------------+----------+-----------+----------+ | 1 | engine | 335 | pune | 33 | | 6 | a/c | 789 | allahabad | 20 | | 2 | brakes | 335 | bombay | 35 | | 3 | car oil | 236 | kolkata | 98 | | 5 | seat cover | 345 | ahemdabad | 35 | | 4 | tyres | 789 | chennai | 168 | +------+------------+----------+-----------+----------+ 6 rows in set (0.00 sec)
mysql> update industry set supplier="hyderabad" where srno="5";
Python Advanced Programming: The Guide to Learn Python Programming. Reference with Exercises and Samples About Dynamical Programming, Multithreading, Multiprocessing, Debugging, Testing and More