02. SQL Basics in Hindi | Database, DBMS, Data Types, Primary Key, Foreign Key, Constraints |
CodeWithMunnaX
0:00 / 0:00
02. SQL Basics in Hindi | Database, DBMS, Data Types, Primary Key, Foreign Key, Constraints |
61 просмотр · 3 дня назад
CodeWithMunnaX
201 подписчик
61 просмотр · 3 дня назад
SQL Basics in Hindi - learn every SQL term you need before writing your first query: data, database, DBMS, database server, schema, tables, rows and columns, SQL Server data types (INT, DECIMAL, CHAR vs VARCHAR, NVARCHAR, DATE, DATETIME2, BIT), candidate key, primary key, foreign key, constraints and table relationships (one-to-one, one-to-many, many-to-many). Every concept is explained with simple Student, Course, Fee and Department tables. Episode 02 of the free SQL Full Course by CodeWithMunnaX.
⬅️ Previous video (01 - SQL Full Course Syllabus): • 01. SQL Full Course Syllabus in Hindi | Le...
🗄️ Free SQL notes with live SQL playground: https://codewithmunnax.com/notes/sql
📘 Notes for this lesson - Database, DBMS and Server: https://codewithmunnax.com/notes/sql/...
🗺️ Roadmaps: https://codewithmunnax.com/roadmap
🌐 All free courses: https://codewithmunnax.com/courses
⏱ TIMESTAMPS
00:00 Intro - basic SQL terminology
00:36 What is Data
02:17 What is a Database
04:47 What is DBMS (Database Management System)
07:07 What is a Database Server - SQL Server, MySQL, PostgreSQL
11:32 What is a Schema
13:59 Table, Rows, Columns, Records and Tuples
19:29 What are Data Types
21:17 Numeric data types - INT, BIGINT, SMALLINT, TINYINT, DECIMAL, FLOAT
27:00 String data types - CHAR vs VARCHAR, NCHAR, NVARCHAR, VARCHAR(MAX)
29:54 Date and time data types - DATE, TIME, DATETIME, DATETIME2, DATETIMEOFFSET
32:49 Boolean values - 1, 0 and NULL
34:30 Keys in SQL
34:50 Candidate Key
38:54 Primary Key
42:43 Primary Key vs Candidate Key
44:28 Foreign Key - Student and Fee table example
49:38 Constraints - PRIMARY KEY, FOREIGN KEY, NOT NULL, UNIQUE, CHECK, DEFAULT
53:16 Relationships - One-to-One
55:52 One-to-Many relationship
56:48 Many-to-Many relationship
57:36 Full recap - Server, Database, Schema, Table, Keys
1:01:13 Homework - install SQL Server, MySQL or PostgreSQL
1:02:33 Next video - SQL queries
📖 WHAT YOU WILL LEARN
Data and Database: data is a collection of raw facts, a database is an organised collection of related data that you can store, access, update and manage.
DBMS and Database Server: a DBMS is the software that creates, stores, retrieves, updates and deletes data. A database server is the machine or process that runs that software - for example SQL Server, MySQL and PostgreSQL.
Schema and Tables: a schema is the blueprint that organises a database. A table is made of rows (also called records or tuples) and columns.
SQL Server Data Types:
Numbers: INT, BIGINT, SMALLINT, TINYINT, DECIMAL(p, s) like DECIMAL(10, 2), FLOAT
Text: CHAR (fixed length, padded with spaces) vs VARCHAR (variable length), NCHAR and NVARCHAR for Unicode text like Hindi and emojis, VARCHAR(MAX) for very long text
Date and time: DATE, TIME, DATETIME, DATETIME2, DATETIMEOFFSET (with time zone)
True or false values: 1, 0 and NULL (the BIT type in SQL Server)
Keys:
Candidate Key - any column or combination of columns that can uniquely identify a row. A table can have many.
Primary Key - the candidate key you choose. It is unique and can never be NULL. Every primary key is a candidate key, but not every candidate key is a primary key.
Foreign Key - a column in one table that refers to the primary key of another table, like StudentID in the Fee table pointing to the Student table.
Constraints: rules on a column or table that keep data valid - PRIMARY KEY, FOREIGN KEY, NOT NULL, UNIQUE, CHECK (for example age greater than 18) and DEFAULT.
Relationships:
One-to-One: one student, one login
One-to-Many: one department, many employees
Many-to-Many: many students in many courses, using a junction table
❓ FAQ
Q: What is the difference between CHAR and VARCHAR?
A: CHAR always uses its full fixed length and pads with spaces. VARCHAR only uses as much space as the text you store.
Q: What is the difference between a primary key and a candidate key?
A: A table can have many candidate keys. The one you pick to identify rows is the primary key, and it can never be NULL.
📝 Homework
1. Install SQL Server, MySQL or PostgreSQL on your laptop.
2. Design a Library table: pick a data type for every column and choose its primary key.
3. Comment one example of a one-to-many relationship from real life.
I will reply to your answers.
━━━━━━━━━━
💬 Doubt? Comment below, I reply to every comment. Free doubt solving: https://codewithmunnax.com/contact
👍 Like, share with a friend who is learning, and subscribe for new Python, SQL and data science videos every week:
/ @codewithmunnax
🌐 Website: https://codewithmunnax.com
📸 Instagram: / codewithmunnax
💼 LinkedIn: / munna-kumar-93234b241
💻 GitHub: https://github.com/CodeWithMunnaX
#SQL #SQLHindi #SQLServer #DBMS #PrimaryKey #ForeignKey #SQLTutorial #LearnSQL #DataAnalytics #CodeWithMunnaX