0% found this document useful (0 votes)
17 views2 pages

MySQL Database and API Operations Guide

Uploaded by

shravyamnayak
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

MySQL Database and API Operations Guide

Uploaded by

shravyamnayak
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

3)

mysql -u root -p
root123

create database studentdb;


use studentdb;

create table students(


rollno int primary key,
name varchar(50),
email varchar(50),
age int);

select * from students;

4)

mysql -u root -p
root123

create database bookdb;


use bookdb;

create table book(


id int primary key auto_increment,
name varchar(50),
author varchar(50),
price int);

select * from book;

(5)

mysql -u root -p
root123

create database mobiledb;


use mobiledb;

create table mobile (


id int primary key auto_increment,
name varchar(50),
model varchar(50),
osystem varchar(50));
curl code
----

# Update mobile (PUT)


curl -X PUT \
-H "Content-Type: application/json" \
-d "{\"id\":1, \"name\":\"Samsung\", \"model\":\"galaxy \", \"osystem\":\"iossss\"}" \
[Link]
------------------------------------

# Get all mobiles (GET)


curl -X GET \
[Link]
---------------------------------------------

# Add new mobile (POST)


curl -X POST \
-H "Content-Type: application/json" \
-d '{"name":"samasung", "model":"redmi11", "osystem":"ios"}' \
[Link]
---------------------------------------------

# Delete mobile by ID (DELETE)


curl -X DELETE \
[Link]

You might also like