Azure Data Studio Tutorial

  Рет қаралды 7,082

Database Star

Database Star

Күн бұрын

Пікірлер: 10
@DatabaseStar
@DatabaseStar Ай бұрын
Want to easily remember the SQL commands for your database? Get my free SQL Cheat Sheets here: databasestar.mykajabi.com/lpkj-sql-cheat-sheets/?
@MartinPopartin-l4b
@MartinPopartin-l4b Ай бұрын
Perfect introduction to Azure Data Studio, thank you so much!
@DatabaseStar
@DatabaseStar Ай бұрын
You're welcome!
@hellohello-dy5nw
@hellohello-dy5nw 5 ай бұрын
Hi, trying my luck here because I've been stuck at this seemingly trivial problem. I love the simplicity you bring in your videos and hope you can shed some light on my issue. I am trying to design a database for the following requirements: 1. A Station can have 0 to N Webcams. 2. An Equipment can have 0 to N Webcams. 3. An Operator can have 0 to N Webcams. 4. A Webcam can only belong to 1 Station, Equipment or Operator. How can I capture this requirement in my database? ChatGPT gave me 3 options: Polymorphic association (having "related_id" and "related_type" columns), Nullable foreign key fields with CHECK constraints (webcam table with equipment, station and operator FK fields) and seperate tables for each webcam type (StationWebcam, EquipmentWebcam, OperatorWebcam). I understand they all have their pros and cons, but generally speaking, which option would you personally recommend for this particular use case? Thank you in advance!
@DatabaseStar
@DatabaseStar 5 ай бұрын
Good question! This is a problem I've seen and the options you've suggested could all work, but have their pros and cons as you mentioned. I would probably create a new table that's like a "parent" of each of the station/equipment/operator tables. This would have a PK and also an FK to the Webcam. Let's call this table "device" (you would probably be able to come up with a better name). Then, each of the Station, Equipment, and Operator tables would have a FK to this device table. It allows the restrcition of one webcam per device type, and also allows for separate tables. This is a great topic for me to create a video on - I'll do this soon!
@hellohello-dy5nw
@hellohello-dy5nw 5 ай бұрын
@@DatabaseStar Hey Ben, thanks for taking the time to answer! In your suggestion, I am struggling to see how each station, equipment or operator can have multiple webcams, due to the FK to the Webcam table existing in the "Device" table. It seems that this setup can only support each station, equipment or operator to only have a single webcam. To paint a better picture of the requirements, imagine a manufacturing factory floor where a physical station (e.g. Assembly Station), an Equipment (e.g. an Oven) and an Operator (e.g. Bob the Human) can all have webcams attached to them for monitoring purposes. In other words, a station, an equipment or an operator can have 0 to many webcams. A webcam will only be able to exclusively serve 1 station, equipment or operator. I've since found an answer in a StackOverflow thread, where they suggested a similar setup that includes a "supertable". The difference is that this "supertable" will only have a PK, and the Station, Equipment, Operator AND Webcam table will have a FK to the "supertable". I've adapted it a little, but this suits my needs of each station, equipment and operator to have multiple webcams associated to them. Let me know if I'm seeing things differently as compared to your answer. I am looking forward to your video! I had to refine my search terms too many times on Google to finally land on the said StackOverflow thread, so the video will really help beginners like me who are facing similar issues. Thanks! StackOverflow thread link: stackoverflow.com/questions/2002985/mysql-conditional-foreign-key-constraints/2003042#2003042
@tamiratabebe6623
@tamiratabebe6623 5 ай бұрын
thank you ❤❤❤
@DatabaseStar
@DatabaseStar 5 ай бұрын
You're welcome!
@lovetheentertainment9949
@lovetheentertainment9949 5 ай бұрын
Please make courses in udemy
@DatabaseStar
@DatabaseStar 5 ай бұрын
I have several courses on my own website here: www.databasestar.com/course-list/
Azure SQL Database Tutorial | Relational databases in Azure
28:20
Adam Marczak - Azure for Everyone
Рет қаралды 370 М.
Azure Data Studio Features in 20 Minutes
18:54
SQLBits
Рет қаралды 40 М.
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
How To Load One BILLION Rows into an SQL Database
12:17
Database Star
Рет қаралды 36 М.
20 Years of SQL Advice in 11 Minutes
11:01
Database Star
Рет қаралды 12 М.
Querying 100 Billion Rows using SQL, 7 TB in a single table
9:07
Arpit Agrawal (Elastiq.AI)
Рет қаралды 57 М.
Azure Data Factory Tutorial | Introduction to ETL in Azure
24:59
Adam Marczak - Azure for Everyone
Рет қаралды 886 М.
DataGrip Tutorial: Getting Started
13:20
Database Star
Рет қаралды 6 М.
How to Connect to MySQL in VS Code and Run SQL
9:54
Database Star
Рет қаралды 1,2 М.