YouTube2Text

Database Design 40 - Data Types — Transcript

by Caleb Curry · 1,773 words · 263 segments · language en · Watch on YouTube

Full transcript

  1. 0:00hey guys welcome back this video we will
  2. 0:02be
  3. 0:02discussing data types I almost forgot
  4. 0:06there anyways what a data type is is
  5. 0:08when you create a
  6. 0:10column every single value in that column
  7. 0:13has to be of a certain data type so you
  8. 0:17need to tell that column when you create
  9. 0:19the database what data type it is to be
  10. 0:22also when you're designing you usually
  11. 0:25put the data types there as well so that
  12. 0:27way you have an idea of how your
  13. 0:29database is going to work work so
  14. 0:31there's three main categories of data
  15. 0:33types and the naming conventions or the
  16. 0:36names of these data types from one
  17. 0:39database management system to another
  18. 0:41database management system might vary a
  19. 0:43little bit but in general they're
  20. 0:45organized into three main kinds that's
  21. 0:49date numeric and
  22. 0:53string so basically we're going to be
  23. 0:56going over these in a little bit of
  24. 0:57depth we're not going to go super in
  25. 0:59depth because right now you just need to
  26. 1:01understand what these are and just
  27. 1:03understand that your database
  28. 1:05application might be slightly different
  29. 1:07from others let's start from the bottom
  30. 1:09up just to make things fun string string
  31. 1:12is any characters or like letters so
  32. 1:16basically you put these within quotes
  33. 1:19so
  34. 1:22hey this is an example of a string even
  35. 1:25a number within quotes can be used as a
  36. 1:28string and this this would be used as a
  37. 1:31string basically
  38. 1:33the uh the three doesn't have any
  39. 1:36mathematical value unless it's converted
  40. 1:39to
  41. 1:40numeric within string you'll often have
  42. 1:43some subcategories you'll have something
  43. 1:46that's either Char or varchar which
  44. 1:50those just mean character or variable
  45. 1:53character what that means is it's just
  46. 1:56like um a list of characters the
  47. 1:58character or char
  48. 2:00usually is stuff that's set in length so
  49. 2:03like a phone number or a zip code
  50. 2:05something that doesn't change sizewise
  51. 2:09so basically with a Char you'll you'll
  52. 2:10have it something
  53. 2:12like CH 8 and every single value within
  54. 2:18that Char column is going to be stored
  55. 2:21as a individual characters now even if
  56. 2:24you don't put eight characters let's say
  57. 2:26you put six then there's going to be two
  58. 2:28blank characters in there so they're all
  59. 2:30stored as eight varar on the other hand
  60. 2:34is variable basically meaning that the
  61. 2:37size can change you can have anywhere
  62. 2:39from zero up to eight there's also often
  63. 2:44the subcategory or subd dat type of text
  64. 2:47which is often used for larger things
  65. 2:50such as comments messages and so forth
  66. 2:54that's basic summary of the string data
  67. 2:57types as for numeric data types
  68. 3:00these are
  69. 3:02numbers that's different than this this
  70. 3:04is a string that has a number in it
  71. 3:07that's used differently than the numeric
  72. 3:09data type the numeric data type doesn't
  73. 3:12have quotes it's just the numbers that
  74. 3:15you're using just like string there's
  75. 3:17often some subcategories of decimal and
  76. 3:20then floating point or
  77. 3:22double
  78. 3:23decimal Works in base 10 now I know we
  79. 3:28haven't really gotten much into
  80. 3:30bases and I'm just going to put date
  81. 3:32back up here since we haven't got that
  82. 3:35yet but I think it's really important to
  83. 3:37know and in fact I've made a lot of
  84. 3:39videos over binary hexadecimal and stuff
  85. 3:42basically different numbering systems
  86. 3:44that use different bases well decimal
  87. 3:47uses base 10 it's the number system
  88. 3:49we're used to counting in you know 0 1 2
  89. 3:523 4 5 6 7 8 9 and then it goes back to
  90. 3:5710 11 12 13 14 if it's base 10 that's
  91. 4:01what de means in decimal well there's
  92. 4:04also
  93. 4:05binary so we
  94. 4:08have decimal and then we have a
  95. 4:12binary decimal is base 10 binaries in
  96. 4:15base two so binary we only have the
  97. 4:19options of zero and one now you don't
  98. 4:22really need to understand how to like
  99. 4:23calculate in binary but if you want to
  100. 4:25know that I do have videos for that but
  101. 4:27just know when we're working with
  102. 4:28decimal it is working with a base 10
  103. 4:32system when we're working with floating
  104. 4:34points we're working with binary which
  105. 4:37is stored differently it's stored in
  106. 4:39binary and then you can have it
  107. 4:41presented as decimal for math or
  108. 4:45whatever so what's really the difference
  109. 4:47do you use decimal or do you use
  110. 4:49floating
  111. 4:50points it just kind of really depends
  112. 4:53decimal generally is more accurate on
  113. 4:57mathematics to a point there are
  114. 4:59problems that can come up with decimal
  115. 5:01but you'll just have to research those
  116. 5:03but
  117. 5:04basically uh this one has some errors
  118. 5:07binary it has problems with certain
  119. 5:10mathematical equations or numbers for
  120. 5:14example when we want to store
  121. 5:181/4 it's stored like this we have
  122. 5:230 Z
  123. 5:25one and the way this kind of works is we
  124. 5:28have anything after the
  125. 5:31point that divides the number basically
  126. 5:36in half so we would have half but we
  127. 5:38don't have half so we have half of a
  128. 5:40half
  129. 5:411/4 kind of makes sense so the the place
  130. 5:44values would be this one right here
  131. 5:47would be uh we'd have
  132. 5:49half this place value would be 1/4 and
  133. 5:54then anything after that would be
  134. 5:571/8 and anything after that would be
  135. 6:00116th so right now way we have it we
  136. 6:04would take 12 multiply it by 0 to get
  137. 6:09zero because we don't have anything
  138. 6:10there we take 1/4 multiply by one since
  139. 6:13we have it there we' get 1/4 0 0 we add
  140. 6:18those up we get 1/4 basic uh adding and
  141. 6:23multiplying to understand how it works
  142. 6:26but when we have a number such as
  143. 6:280.1
  144. 6:31in decimal that is basically impossible
  145. 6:35to store in binary simply because we're
  146. 6:38working in a base 2 system and we can't
  147. 6:42get 2.1 very easily because 1/8 that
  148. 6:46doesn't quite cut it you'd have to
  149. 6:48basically have a combination of a bunch
  150. 6:51of different fractions to get as close
  151. 6:53as possible 2.1 but you can never really
  152. 6:55get there perfectly so that's a problem
  153. 6:57with the floating points
  154. 7:00so if you needed to store something like
  155. 7:01that you would if it needs to have that
  156. 7:04accuracy you would have to have it
  157. 7:05stored as a decimal which stores it
  158. 7:10differently that was a lot sorry if I
  159. 7:12completely overwhelmed you with that
  160. 7:13number stuff and if I did don't even
  161. 7:16worry about it that was a little too
  162. 7:17fast if you need it slower please check
  163. 7:20out my introduction to Binary video it's
  164. 7:24a super long video where I basically
  165. 7:26explain it step by step so you
  166. 7:28understand and then I have a couple
  167. 7:30other videos adding and subtracting and
  168. 7:32also fractions in a binary you will also
  169. 7:36have an integer type which will only
  170. 7:38store numbers that don't have any
  171. 7:40decimals after them so only whole
  172. 7:42numbers like 5 12 28 52 so forth with
  173. 7:47numbers we also have to worry about
  174. 7:48whether they are unsigned or signed if
  175. 7:51they are unsigned numbers that means
  176. 7:53that they can't be negative if they're
  177. 7:55signed that means they can be positive
  178. 7:57or negative you're probably wondering
  179. 7:58why would you ever do that well if
  180. 8:00you're working with something that
  181. 8:01doesn't go negative well then you
  182. 8:03wouldn't need to have that negative when
  183. 8:05you have a signed number and it can be
  184. 8:07positive or negative the range of
  185. 8:11potential values stays the same but
  186. 8:14since you include negatives the maximum
  187. 8:17value is different it's not as high
  188. 8:21think about if you have a range from 0
  189. 8:23to a
  190. 8:24th000 but then you include negatives now
  191. 8:26you have from 500 to 500 that is going
  192. 8:29to be told with the data type so you
  193. 8:31might say something like
  194. 8:34double
  195. 8:36unsigned that would work as a number
  196. 8:39that's enough for numbers I don't want
  197. 8:41to talk about this anymore let's talk
  198. 8:42about dates dates well there's couple
  199. 8:46different things you need to know about
  200. 8:47dates there's date then there's time
  201. 8:51there's date time and then there's
  202. 8:53timestamp so let's talk about date time
  203. 8:55first because it makes sense the best it
  204. 8:58basically just stores a dates such as
  205. 9:00you know 02 for February then you might
  206. 9:03have a colon you might have 22 for the
  207. 9:05date 22nd and then a colon maybe
  208. 9:101998 for 1998 the year then you have the
  209. 9:14time which could be whatever it could be
  210. 9:1712 30 22 which would be the seconds and
  211. 9:21you might even be able to have some
  212. 9:22milliseconds or micros
  213. 9:24seconds that's how you would store a
  214. 9:26date time the way it actually looks
  215. 9:29might vary from database management
  216. 9:31system to database management system
  217. 9:33some might have colons between the
  218. 9:35numbers some some might have hyphens or
  219. 9:38commas or whatever doesn't really matter
  220. 9:40I don't want you to think about that
  221. 9:41right now I just want you to think about
  222. 9:43the date being a date and the time being
  223. 9:47a time date time being the combination
  224. 9:50of a date and a time that's pretty much
  225. 9:54that for dates the only other thing is
  226. 9:56the time stamp the time stamp is an ex
  227. 9:59exact moment in time that's recorded to
  228. 10:02establish when something was created or
  229. 10:05done it can be in milliseconds or it can
  230. 10:08be in the month and the day and then the
  231. 10:11second hour and then the seconds and
  232. 10:13then the milliseconds or it can just be
  233. 10:15a number of seconds so forth it varies
  234. 10:18but anyways that's going to give you a
  235. 10:20number when something was done it's
  236. 10:23usually for something like when an
  237. 10:25account was created or when a
  238. 10:27transaction was done or when something
  239. 10:29happened when you update a column that
  240. 10:32Tim stamp will often
  241. 10:34update and that's going to keep it to
  242. 10:37like when that row was entered into the
  243. 10:41database so if you enter a new row and
  244. 10:44one of the columns is a timestamp it's
  245. 10:47going to give you a value as soon as you
  246. 10:49submit that and it's put into the
  247. 10:51database the timestamps created and it
  248. 10:53says okay this row was entered at this
  249. 10:55time that's the main thing with um
  250. 10:57timestamps so so basically we got three
  251. 10:59types of data types we got
  252. 11:02string um numeric and then date all of
  253. 11:06those classifications have different
  254. 11:09data types for each one but in general
  255. 11:12as long as you know like the gist of
  256. 11:14what is what you'll be fine you don't
  257. 11:17have to worry too much because when you
  258. 11:18get in actually programming a database
  259. 11:20you will have more specifics on what
  260. 11:22data types to use so you guys thank you
  261. 11:25for watching sorry for rambling in this
  262. 11:26video is a long one
  263. 11:29peace out

About this transcript

This page contains the full transcript of Database Design 40 - Data Types by Caleb Curry, generated from the public captions YouTube serves with the video. The transcript has 1,773 words across 263 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.